import message from 'ant-design-vue/es/message'
// import defaultSettings from '../defaultSettings';
import themeColor from './themeColor.js'

const updateTheme = (newPrimaryColor, showTip = true) => {
  if (showTip) {
    const hideMessage = message.loading('正在切换主题！', 0)
    themeColor.changeColor(newPrimaryColor).finally(() => {
      setTimeout(() => {
        hideMessage()
      }, 10)
    })
  } else {
    themeColor.changeColor(newPrimaryColor)
  }
}

export { updateTheme }
